<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file="/manage/system/pageBase.jsp" %>
<%@ page info="律师列表" %>
<%
    Map<String,String> statuss = new LinkedHashMap<String,String>();
    statuss.put("y","显示");
    statuss.put("n","不显示");
%>
<form action="<%=path %>/manage/lawyer" name="form" id="form" method="post">
    <div style="height:auto!important;height:550px;min-height:550px;">
        <h3 style="border-bottom: 1px solid #D7D7D7;color: #666666;font-size: 28px;padding-bottom: 20px;margin-bottom: 30px;">
            <%=getServletInfo()%>
            <a href="<%=path %>/manage/lawyer/selectList" class="btn btn-primary"
               style="padding: 2px 15px;float:right;"><i class="icon-double-angle-left"></i>返回列表</a>
        </h3>
        <table width="100%" border="0" cellspacing="0" cellpadding="10" class="tableBasic">

            <tr style="display: none;">
                <td>lawyerId</td>
                <td><input type="hidden" value="${e.lawyerId}" name="lawyerId" label="lawyerId"/></td>
            </tr>
            <tr>
                <th style="text-align: right;" width="200">律师姓名</th>
                <td style="text-align: left;">
                    <input type="text" size="40" value="${e.lawyerName}" name="lawyerName"
                                                     data-rule="姓名:required;lawyerName;length[1~45];"
                                                     id="lawyerName"/>
                </td>
            </tr>

            <tr>
                <th style="text-align: right;" width="200">排序</th>
                <td style="text-align: left;">
                    <input οnkeyup="value=value.replace(/[^\d]/g,'') "
                           onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"
                           id="spare" name="spare" value="${e.spare}" size="40" data-rule="排序：required">
                </td>
            </tr>

            <tr>
                <th style="text-align: right;" width="200">擅长</th>
                <td style="text-align: left;">
                    <input type="text" size="40" value="${e.expert}" name="expert"
                           data-rule="擅长:required;expert;length[1~225];"
                           id="expert"/>
                </td>
            </tr>
            <tr>
                <th style="text-align: right;">头像</th>
                <td style="text-align: left;"><input type="text"  size="40" id="image" name="image" value="${e.image}"/>
                    <input type="button" name="imageFile" value="选择图片" class="btn btn-primary" style="padding: 0px 12px;margin-top: -5px;"/>
                </td>
            </tr>
            <tr>
                <th style="text-align: right;">简介信息</th>
                <td style="text-align: left;">
                    <textarea name="lawyerIntroduce" id="lawyerIntroduce" data-rule="简介内容:required;"
                              rows="10" cols="100">${e.lawyerIntroduce}</textarea>
                </td>
            </tr>
            <tr>
                <th style="text-align: right;">百度百科链接</th>
                <td style="text-align: left;">
                    <textarea name="workExperience" id="workExperience" data-rule="百度百科链接:required;"
                              rows="2" cols="100">${e.workExperience}</textarea>
                </td>
            </tr>
            <%--<tr>
                <th style="text-align: right;">简介专业经验</th>
                <td style="text-align: left;">
                    <textarea name="professionalExperience" id="professionalExperience" data-rule="专业经验:required;"
                              rows="5" cols="100">${e.professionalExperience}</textarea>
                </td>
            </tr>
            <tr>
                <th style="text-align: right;">简介擅长领域</th>
                <td style="text-align: left;">
                    <textarea name="areasOfExpertise" id="areasOfExpertise" data-rule="擅长领域:required;"
                              rows="5" cols="100">${e.areasOfExpertise}</textarea>
                </td>
            </tr>--%>
            <tr>
                <td colspan="2" style="text-align: center;">
                    <c:choose>
                        <c:when test="${e.lawyerId != null}">
                            <button method="update" onclick="commit(this)" class="btn btn-info"
                                    style="padding:2px 15px;">
                                保存
                            </button>
                        </c:when>
                        <c:otherwise>
                            <button method="insert" onclick="commit(this)" class="btn btn-info"
                                    style="padding:2px 15px;">
                                新增
                            </button>
                        </c:otherwise>
                    </c:choose>
                </td>
            </tr>
        </table>
    </div>
</form>

<script type="text/javascript">


    KindEditor.ready(function (K) {

        var editor = K.editor({
            allowFileManager : true,
            uploadJson: '<%=path%>/resource/kindeditor/jsp/upload_json.jsp',
            fileManagerJson : '<%=path%>/resource/kindeditor/jsp/file_manager_json.jsp'
        });

        K('input[name=imageFile]').click(function() {
            editor.loadPlugin('image', function() {
                editor.plugin.imageDialog({
                    imageUrl : K('#image').val(),
                    clickFn : function(url) {
                        K('#image').val(url);
                        editor.hideDialog();
                    }
                });
            });
        });


    });
    function commit(obj) {
        var _form = $("form");
        _form.attr("action", $(obj).attr("method"));
        _form.submit();
    }
</script>


<%@ include file="/manage/system/baseFoot.jsp" %>
